<?php
include_once "../common.php";

$_SESSION['webshop'] = false;
unset($_SESSION['webshop']);

if(isset($_POST['webshopID']) && !empty($_POST['webshopID']) && is_numeric($_POST['webshopID']))
{
	$query = "	SELECT 
					* 
				FROM Webshops 
				WHERE ID = '".str_replace("'","",$_POST['webshopID'])."'
					AND CustomerID = '".str_replace("'","",$_SESSION['login']['ID'])."'";
	$result = $_MySQL->runQuery($query);
	if($_SESSION['login']['ID'] < 5 && mysql_num_rows($result) >= 1)
	{
		// ok, select this one
		$_SESSION['webshop'] = mysql_fetch_assoc($result);
		echo "succes";
	}
	else
	{
		echo "Niet uw webshop";
	}
}
else
{
	echo "Geen webshop geselecteerd";
}